package com.xy.farm.activity.farm;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.xy.farm.R;
import com.xy.farm.activity.base.BaseActivity;
import com.xy.farm.activity.farm.adapter.PlantAdapter;

public class PlantActivity extends BaseActivity
{
    private RecyclerView recyclerView;
    private PlantAdapter adapter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_plant);
        findViewById(R.id.btn_back).setOnClickListener(this);
        setTitle("有机无添加小白菜");
        recyclerView = findViewById(R.id.recyclerView);
        LinearLayoutManager manager = new LinearLayoutManager(this)
        {
            @Override
            public boolean canScrollVertically()
            {
                return false;
            }
        };
        recyclerView.setHasFixedSize(true);
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter((adapter = new PlantAdapter()));
    }
}
